import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/AboutView.vue')
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/login.vue')
    },
    {
      path: '/tab',
      name: 'tab',
      component: () => import('../views/tab.vue'),
      children: [
        { path: '/health', name: 'health', component: () => import('../views/health.vue') },
        { path: '/index', name: 'index', component: () => import('../views/index.vue') },
        { path: '/news', name: 'news', component: () => import('../views/news.vue') },
        { path: '/my', name: 'my', component: () => import('../views/my.vue') }
      ]
    }
  ]
})

export default router
